<script lang="ts" setup>
const {wechat} = defineProps<{ wechat: { id: string, visible: boolean } }>()

// 自定义事件
defineEmits<{ (e: 'onCancel'): void }>()

</script>

<template>
    <div class="wechat" v-if="wechat.visible">
        <div class="bg">
            <div class="content flexc flex-col wfull relative">
                <cdn-img @click="$emit('onCancel')" src="/images/svg/close_icon.svg"
                         class="absolute top-30px right-30px cursor-pointer select-none"/>
                <span flex text-22px color="#404040" mb-25px>请使用<span color="#1BB723">微信</span>扫码支付</span>
                <!-- 微信二维码 -->
                <div w-200px h-200px p-20px b="~ #d7d7d7 rounded-5px">
                    <div :id="wechat.id"/>
                </div>
                <p mt-24px color="#7f7f7f" ml-15px>请尽快扫码完成支付，以便订单尽快处理！</p>
            </div>
        </div>
    </div>
</template>

<style lang="less" scoped>
.wechat {
    overflow: hidden;
}

.bg {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.content {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: auto;
    outline: 0;
    z-index: 1200;
    width: 450px;
    height: 450px;
    margin: auto;
    border-radius: 10px;
    background-color: white;
    padding: 30px;
    box-shadow: 0px 0px 10px 0px rgba(150, 149, 149, 0.6);
}
</style>